package com.example.androidframework.ui.course.seriesback

import android.annotation.SuppressLint
import android.content.Context
import android.content.Intent
import android.os.Bundle
import android.widget.Button
import androidx.activity.enableEdgeToEdge
import androidx.appcompat.app.AppCompatActivity
import androidx.core.view.ViewCompat
import androidx.core.view.WindowInsetsCompat
import com.example.androidframework.R
import com.martin.lib_base.ktx.logw
import com.martin.lib_base.utils.FishActivityCollector
import com.martin.lib_base.utils.FishStackManager

class PageCActivity : AppCompatActivity() {
    @SuppressLint("MissingInflatedId")
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_page_c)
        FishStackManager.pushActivity(this)
        FishActivityCollector.addActivity(this)

        findViewById<Button>(R.id.button).setOnClickListener {
            PageDActivity.start(this)
        }
    }

    override fun onDestroy() {
        super.onDestroy()
        FishStackManager.popActivity(this)
        FishActivityCollector.removeActivity(this)
        logw("Page C on destory")
    }

    companion object {
        fun start(context: Context) {
            val intent = Intent(context, PageCActivity::class.java)
            context.startActivity(intent)
        }
    }
}